<template>
	<q-upload
		:file-list="forms.fileList"
		action="/api/config/imgUpload"
		name="file"
		:on-success="handleSuccess"
		:with-credentials="true"
		:size="200"
		:limit="5"
		:multiple="true"
	/>
</template>

<script setup lang="ts">
	import { reactive, onMounted } from 'vue';

	const tempFileList = [
		'http://mktcdn-clio-stg2.360jie.com.cn/dir_mkteditor/pic/a0afffa65dc44ee2a6a67ff957283f74.jpeg',
		'http://mktcdn-clio-stg2.360jie.com.cn/dir_mkteditor/pic/bcda5907d41b42f2b4220cae70a94072.svga',
		'http://mktcdn-clio-stg2.360jie.com.cn/dir_mkteditor/pic/b40f2066b5264c19bf8dcf1efd7d29c1.jpeg',
		'http://mktcdn-clio-stg2.360jie.com.cn/dir_mkteditor/pic/2f3f2db7b517449388b3f62a5bd38f9e.svga',
	];

	const forms = reactive({
		fileList: [],
	});
	const handleSuccess = res => {
		console.log('res', res);
		forms.fileList = res;
	};
	onMounted(() => {
		// 数据回显
		forms.fileList = tempFileList;
	});
</script>
<style lang="scss">
	.wrapper {
		padding: 20px;
	}
</style>
